import request from '@/api/myRequest'

// 获取列表
function productList(start, limit, data) {
  return request({
    url: `/lejuAdmin/product/productsByPage/${start}/${limit}`, // 相对路径
    method: 'post',
    data
  })
}
// 删除商品
function productDel(productId) {
  return request({
    url: `/lejuAdmin/product/del/${productId}`,
    method: 'DELETE'
  })
}

// 是否最新
function switchNewStatus(data) {
  return request({
      url: '/lejuAdmin/product/switchNewStatus', 
      method: 'post',
      data
  })
}
// 是否推荐状态
function switchRecommendStatus(data) {
  return request({
      url: '/lejuAdmin/product/switchRecommandStatus', 
      method: 'post',
      data
  })
}

// 是否审核状态
function switchVerifyStatus(data) {
  return request({
      url: '/lejuAdmin/product/switchVerifyStatus', 
      method: 'post',
      data
  })
}

// 是否发布状态
function switchPublishStatus(data) {
  return request({
      url: '/lejuAdmin/product/switchPublishStatus',
      method: 'post',
      data
  })
}
export default {
  productList,
  productDel,
  switchNewStatus,
  switchRecommendStatus,
  switchVerifyStatus,
  switchPublishStatus
}